cmake_minimum_required(VERSION 3.12)
project(cuda_imageprocessing)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

## Find catkin macros and libraries
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
## is used, also find other catkin packages
find_package(catkin REQUIRED COMPONENTS
  roscpp
  sensor_msgs
)

find_package(CUDA REQUIRED)
message(STATUS "CUDA_VERSION: ${CUDA_VERSION}")

## System dependencies are found with CMake's conventions
find_package(Boost REQUIRED COMPONENTS system)

###################################
## catkin specific configuration ##
###################################
catkin_package(
#  INCLUDE_DIRS include
#  LIBRARIES cuda_imageprocessing
#  CATKIN_DEPENDS roscpp sensor_msgs
#  DEPENDS system_lib
)

###########
## Build ##
###########

file( GLOB LIB_HEADERS include/cuda_imageprocessing/*.hpp include/nvJPEG/*.h )

## Specify additional locations of header files
## Your package locations should be listed before other locations
include_directories(
  include
  ${catkin_INCLUDE_DIRS}
  ${CUDA_INCLUDE_DIRS}
)

## Declare a C++ library
add_library(${PROJECT_NAME}
  ${LIB_HEADERS}
)

add_executable(image_processing src/image_processing.cpp)

set_target_properties(${PROJECT_NAME} PROPERTIES LINKER_LANGUAGE CXX)

## Specify libraries to link a library or executable target against
target_link_libraries(image_processing
  ${catkin_LIBRARIES}
  ${CUDA_LIBRARIES}
  nppisu
  nppig
  nppicc
  nvjpeg
)
